const axios = require('axios');
const { log } = require('../utils/log');

// 封装请求接口
function getUrlData(host, router, queryString) {
  let url = `${host}/${router}?${queryString}`;
  log('请求地址', url);
  return axios.get(url).catch(err => {
    console.log('请求出现错误❌', err);
  });
}

exports.getUrlData = getUrlData;
